--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

function widget:GetInfo()
  return {
    name      = "Drawing lib testing",
    desc      = "Testing the drawing lib",
    author    = "user",   
    date      = "someday",
    license   = "GNU GPL, v2 or later",
    layer     = 2,
    enabled   = false 
  }
end

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

VFS.Include("LuaLibs/Drawing Lib.lua",nil,VFS.RAW) 
local e = Spring.Echo
local c = math.ceil
local mode = "quads"
local sx,sy,sz = 9100,3072,7110 

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

function widget:DrawWorld()
   gl.DepthTest(true)
   gl.Blending(true)
   gl.Lighting(true)
   gl.Fog(false)
   gl.Color(0.9,0.9,0.3,0.9)
   gl.DepthMask(true)


   gl.PushMatrix()
   gl.Translate(sx,sy,sz)
   --gl.Billboard()
   gl.CallList(light)
   gl.PopMatrix() 

   gl.Sphere(32,32,100,"quads", 1224, 1024, 1024)  

   gl.DepthMask(false)
   gl.Fog(true)
   gl.Texture(false)
   gl.Color(1,1,1,1)
   gl.Lighting(false)        
   gl.DepthTest(false)
   gl.Blending(GL.SRC_ALPHA,GL.ONE_MINUS_SRC_ALPHA)
   gl.Light(1, false)
end

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

function widget:Initialize()
   light = gl.CreateList(gl.Grid,2500,0,0,0,GL.QUADS,3,3,true)
end

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------